<?php
/*
 * 用户的数据库操作类
 * @package    Db
 * @author     Mark
 * @copyright  Copyright (c) 2013 ixdcw team
 * @version    $Id: 56889b9bf99aeb9281a6b30b2b8f3e4e0496ef50 $
 */
defined('IN_IXDCW') or exit('Access Denied');
final class MemberDb extends CoreDb{

	public function __construct(){
		parent::__construct();
	}

	function getByUsername($username, $fields = '*') {
		$sql = "
			SELECT $fields
			FROM " . $this->tableName() . "
			WHERE username='$username'";
		return $this->_db->getOne($sql);
	}

	function getByUserid($userid, $fields = '*') {
		$sql = "
			SELECT $fields
			FROM " . $this->tableName() . "
			WHERE userid='$userid'";
		return $this->_db->getOne($sql);
	}
}